import {defineStore} from 'pinia'
export const useInfoStore=defineStore('info',{
   state:()=>({
      queCount:localStorage.getItem("queCount")?parseInt(localStorage.getItem('queCount')):0
      ,tokenCount:localStorage.getItem("tokenCount")?parseInt(localStorage.getItem('tokenCount')):0
      ,imgCount:localStorage.getItem("imgCount")?parseInt(localStorage.getItem('imgCount')):0
   })
   ,getters:{
      queInfo:(state)=>{
        return state.queCount==0?"未开始使用":queCount
      }
   }
   ,actions:{
      addQue(){
        this.queCount+=1;
        localStorage.setItem("queCount",this.queCount)
      },
      addToken(num){
        this.tokenCount+=num;
        localStorage.setItem("tokenCount",this.tokenCount)
      },
      addImg(num){
        this.imgCount+=num;
        localStorage.setItem("imgCount",this.imgCount)
      }
   }

})